package org.jeecg.common.util;

import org.apache.commons.lang.StringUtils;

public enum  QCloudSmsEnum {
    LOGIN_TEMPLATE_CODE(855371,"沈阳翱翔航空科技有限公司",1400479951,"86b706eba25ba04a96642ea8628c956d"),
    FORGET_PASSWORD_TEMPLATE_CODE(861830,"沈阳翱翔航空科技有限公司",1400479951,"86b706eba25ba04a96642ea8628c956d"),
    REGISTER_TEMPLATE_CODE(855279,"沈阳翱翔航空科技有限公司",1400479951,"86b706eba25ba04a96642ea8628c956d");
    /**会议通知*/
//    MEET_NOTICE_TEMPLATE_CODE("SMS_201480469","H5活动之家","username,title,minute,time"),
    /**我的计划通知*/
//    PLAN_NOTICE_TEMPLATE_CODE("SMS_201470515","H5活动之家","username,title,time");

    /**
     * 短信模板id
     */
    private int templateId;
    /**
     * 签名内容
     */
    private String smsSign;
    /**
     * 短信模板必需的数据名称，多个key以逗号分隔，此处配置作为校验
     */
    private int appid;
    private String appkey;



    private QCloudSmsEnum(int templateId, String smsSign, int appid, String appkey) {
        this.templateId = templateId;
        this.smsSign = smsSign;
        this.appid = appid;
        this.appkey = appkey;
    }

    public int getTemplateId() {
        return templateId;
    }

    public void setTemplateId(int templateId) {
        this.templateId = templateId;
    }

    public String getSmsSign() {
        return smsSign;
    }

    public void setSmsSign(String smsSign) {
        this.smsSign = smsSign;
    }

    public int getAppid() {
        return appid;
    }

    public void setAppid(int appid) {
        this.appid = appid;
    }

    public String getAppkey() {
        return appkey;
    }

    public void setAppkey(String appkey) {
        this.appkey = appkey;
    }

    public static DySmsEnum toEnum(String templateCode) {
        if(StringUtils.isEmpty(templateCode)){
            return null;
        }
        for(DySmsEnum item : DySmsEnum.values()) {
            if(item.getTemplateCode().equals(templateCode)) {
                return item;
            }
        }
        return null;
    }
}
